<%-- 
    Document   : income
    Created on : 12/12/2009, 15:58:27
    Author     : eduardo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Gerenciador Financeiro - Controle de Receitas</title>
        </head>
        <body>
            <h1><h:outputText value="Edição de receitas"/></h1>

            <h:form>
                <h:dataTable value="#{IncomeFace.incomes}" var="incomes">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Id" />
                        </f:facet>
                        <h:outputText value="#{incomes.id}" />
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Descricao" />
                        </f:facet>
                        <h:outputText value="#{incomes.descriptionIncome}" />
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Data" />
                        </f:facet>
                        <h:outputText value="#{incomes.data}">
                            <f:convertDateTime dateStyle="short" />
                        </h:outputText>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Valor" />
                        </f:facet>
                        <h:outputText value="#{incomes.value}">
                            <f:convertNumber type="currency" />
                        </h:outputText>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Acoes" />
                        </f:facet>
                        <h:commandLink value="Editar" action="#{IncomeFace.doStartUpdate}">
                            <f:setPropertyActionListener target="#{IncomeFace.incomeInEdit}" value="#{incomes}"  />
                        </h:commandLink>
                        /
                        <h:commandLink value="Excluir" action="#{IncomeFace.doRemove}">
                            <f:setPropertyActionListener target="#{IncomeFace.incomeInEdit}" value="#{incomes}"  />
                        </h:commandLink>
                    </h:column>
                </h:dataTable>

                <h:commandLink value="Voltar" action="goToMain"/>
                /
                <h:commandLink value="Adicionar" action="#{IncomeFace.doStartAdd}"/>
            </h:form>

        </body>
    </html>
</f:view>
